package com.example.xyxwebbackend001.service;

import com.example.xyxwebbackend001.model.vo.ArticlePathListVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Description;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.function.Function;

@Service
public class BookingTools {
    @Autowired
    private CPostsService cPostsService;

    public record  GetTagsRequest(String tags) {}

    @Bean
    @Description("根据关键词获取相应的文章链接")
    public Function<GetTagsRequest, List<ArticlePathListVO>> getCultureList() {
        return  getTagsRequest -> {
            return cPostsService.getArticlePathList(getTagsRequest.tags());
        };
    }
}
